/*******************************************************************************
				FIGURE 1
*******************************************************************************/

*WAGE IV
*FIGURE 1 PANEL A: TAKE UP BY WAGE.
clear 
cap{

use "$data/fig1.dta", clear

qui: cmogram sej2009 w if w>0 & w<600000 & edad<=25, scatter ///
	cut(360000) gen(x) 
graph close _graph0

tw (scatter xy0 xx0, mcolor(black) mfcolor(none) msize(medium) mlwidth(medium)) ///
	(scatter xy1 xx1, mcolor(black) mfcolor(none) msize(medium) mlwidth(medium)), ///
	graphregion(color(white)) ///
	plotregion(lcolor(black)) ///
	ylabel(0(0.05)0.30,format(%3.2fc) nogrid) ///
	xlabel(0(200000)600000,format(%12.0fc)) xmlabel(0(100000)600000,nolabel) ///
	legend(off) ///
	xtitle("Wage (in CLP)") ///
	ytitle("Take-up") ///
	xline(360000, lcolor(black) lp(dash)) ///
	name("Figure1_PanelA",replace) 
	graph export "$results/Figure1_PanelA.pdf", replace
clear
}

*AGE IV
*FIGURE 1, PANEL B: TAKE UP BY AGE.
clear 
cap{

use "$data/fig1.dta", clear

qui: cmogram sej2009 edad if w<360000 & edad>18.5, scatter ///
	cut(25) gen(x) 
graph close _graph0

tw (scatter xy0 xx0, mcolor(black) mfcolor(none) msize(medium) mlwidth(medium)) ///
	(scatter xy1 xx1, mcolor(black) mfcolor(none) msize(medium) mlwidth(medium)), ///
	graphregion(color(white)) ///
	plotregion(lcolor(black)) ///
	ylabel(0(0.05)0.30,format(%3.2fc) nogrid) ///
	xlabel(19(1)27,format(%12.0fc)) xmlabel(19(.5)27,nolabel) ///
	legend(off) ///
	xtitle("Age") ///
	ytitle("Take-up") ///
	xline(25, lcolor(black) lp(dash)) ///
	name("Figure1_PanelB",replace)
	graph export "$results/Figure1_PanelB.pdf", replace
clear
}
